﻿using System;
using System.Runtime.Serialization;
using Director.StockSharp.Transaq.Native.Responses;

namespace Director.DomainModels
{
	[DataContract]
	public class TimeFrame : Identifiable
	{
		internal TimeFrame(CandleKind candleKind)
			: base(candleKind.Id, candleKind.Name)
		{
			TimeFrameLength = candleKind.Period;
			Length = TimeSpan.FromSeconds(candleKind.Period);
		}

		[DataMember]
		public TimeSpan Length { get; set; }

		/// <summary>
		/// Размер в секундах
		/// </summary>
		[DataMember]
		public int TimeFrameLength { get; private set; }
	}
}